package cn.itcast.bos.dao.system;

import cn.itcast.bos.domain.system.Role;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface RoleRepository extends JpaRepository<Role,Integer>{
    @Query(value = "select r from Role r inner join fetch r.users u where u.id = ?1")
    List<Role> findByUser(int uid);
}
